package io.github.yotta.logger.example.param;

import lombok.Data;

/**
 * @author yotta
 * @date 2025/3/14 17:40
 */
@Data
public class Result<T> {

    private T data;

    private String message;

    private Integer code;

    public static <T> Result<T> success(T data) {
        Result<T> result = new Result<>();
        result.setData(data);
        result.setCode(200);
        result.setMessage("success");
        return result;
    }

    public static <T> Result<T> error(Integer code, String message) {
        Result<T> result = new Result<>();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }
}
